public class CountTime extends  Thread{
    int count;
    public CountTime(int count){
        this.count=count;
    }
    public void run(){
        while (count>0){
            System.out.print(count+" ");
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
            count--;
        }
    }

    public static void main(String[] args) {
        CountTime ct = new CountTime(5);
        ct.start();
    }
}
